import request from '@/utils/request.js'
const PATH = '/admin/user'

// 获取用户列表
export const getUserList = ({ page, pageSize, name }) =>
  request.get(PATH + '/page', { params: { page, pageSize, name } })

// 新增用户
export const addUser = (data) => request.post(PATH + '/add', data)

// 修改用户状态
export const updateStatus = ({ id, status }) =>
  request.put(PATH + `/update/${id}/${status}`)

// 删除用户
export const deleteByIds = (ids) =>
  request.delete(PATH + '/deleteByIds', { params: { ids: ids.join(',') } })

// 修改用户信息
export const updateUser = (data) => request.put(PATH + '/update', data)
